package com.itheima.paymentdemo.service;


import com.baomidou.mybatisplus.extension.service.IService;
import com.itheima.paymentdemo.entity.OrderInfo;
import com.itheima.paymentdemo.enums.OrderStatus;

import java.util.List;


public interface OrderInfoService extends IService<OrderInfo> {

    //根据商品id创建一个订单对象
    OrderInfo createOrderByProductId(Long productId);

    //将二维码的地址存储起来 当二维码在两个小时有效期内，可将携带同一信息的二维码重复调出，不必频繁申请
    void saveCodeUrl(String orderNo,String codeUrl);

    List<OrderInfo> listOrderByCreateTimeDesc();

    void updateStatusByOrderNo(String orderNo, OrderStatus orderStatus);

    //获取订单状态，查看是否是未支付
    String getOrderStatus(String orderNo);

    List<OrderInfo> getNoPayOrderByDuration(int minutes);

    OrderInfo getOrderByOrderNo(String orderNo);
}
